package com.book.service;

import com.book.dao.readerDao;
import com.book.po.Reader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class readerService {
    @Autowired
    private readerDao readerDao;

    public Reader login(Reader reader) {
        return readerDao.login(reader);
    }

    public List<Reader> reader_select(Reader reader) {
        return readerDao.reader_select(reader);
    }


    public String reader_update(Reader reader) {
        if (readerDao.reader_update(reader) != 0) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
    public String reader_insert(Reader reader){
        if (readerDao.reader_insert(reader) != 0) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }

    public String reader_delete(Integer readerId) {
        if (readerDao.reader_delete(readerId) != 0) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }


}
